describe('practice-3-2', function () {

    it("求3000以内亲密数的个数", function () {
        var arr_intimate_number = get_intimate_number();
        console.info(arr_intimate_number);
        var length = arr_intimate_number.length;
        expect(length).toBe(3);
        expect(arr_intimate_number[0].number_A !== arr_intimate_number[length - 1].number_A).toBe(true);
        for(var i = 0; i < arr_intimate_number.length; i ++)
        {
            var sum_a = 0;
            var sum_b = 0;
            var number_a = arr_intimate_number[i].number_A;
            var number_b = arr_intimate_number[i].number_B;
            for(var m = 1; m < number_a; m ++)
            {
                if(number_a % m === 0)
                    sum_a += m;
            }
            for(var n = 1; n < number_b; n ++)
            {
                if(number_b % n === 0)
                    sum_b += n;
            }
            expect(sum_a == number_b && sum_b == number_a).toBe(true);
        }
    });

});